using Unity.Mathematics;

namespace DA.AnimGraph {

    public enum LinkSourceType : byte {
        Const,
        Blackboard,
        //Curve, // 对时序有要求
    }

    public struct FloatLinkDesc {
        public AUID name;
        public float defaultValue;
        public float easeTime;
        public float2 clampRange;
        public LinkSourceType sourceType;
        public EaseType easeType;
        public EaseFunctionType easeFunctionType;
        public bool useClamp;

        public FloatLinkDesc(float constValue) {
            defaultValue = constValue;
            sourceType = LinkSourceType.Const;
            name = default;
            useClamp = false;
            clampRange = new float2(0, 1);
            easeType = EaseType.None;
            easeFunctionType = EaseFunctionType.Linear;
            easeTime = 0;
        }

        public FloatLinkDesc(AUID name) {
            this.name = name;
            sourceType = LinkSourceType.Blackboard;
            defaultValue = default;
            useClamp = true;
            clampRange = new float2(0, 1);
            easeType = EaseType.None;
            easeFunctionType = EaseFunctionType.Linear;
            easeTime = 0;
        }
    }

    public struct IntLinkDesc {
        public AUID name;
        public int defaultValue;
        public LinkSourceType sourceType;

        public IntLinkDesc(AUID name) {
            this.name = name;
            sourceType = LinkSourceType.Blackboard;
            defaultValue = default;
        }
        public IntLinkDesc(int constValue) {
            defaultValue = constValue;
            sourceType = LinkSourceType.Const;
            name = default;
        }
    }

    public struct Vector2LinkDesc {
        public AUID name;
        public LinkSourceType sourceType;
        public float2 defaultValue;
        public bool useClamp;
        public float2 clampRangeX;
        public float2 clampRangeY;

        public Vector2LinkDesc(AUID name) {
            this.name = name;
            sourceType = LinkSourceType.Blackboard;
            defaultValue = float2.zero;
            useClamp = true;
            clampRangeX = new(0, 1);
            clampRangeY = new(0, 1);
        }
    }

    public struct ClipLinkDesc {
        public AUID uuid;

        public ClipLinkDesc(AUID uuid) {
            this.uuid = uuid;
        }
    }

    public struct MaskLinkDesc {
        public AUID uuid;

        public MaskLinkDesc(AUID uuid) {
            this.uuid = uuid;
        }
    }
}
